package samples.version;

import br.cin.ufpe.in1118.middleware.distribution.services.naming.Naming;
import br.cin.ufpe.in1118.middleware.distribution.services.naming.NamingService;
import br.cin.ufpe.in1118.middleware.exceptions.RemoteException;

public class VersionClient {

	public static void main(String[] args) {
		Version version = null;
		Naming naming = NamingService.getNamingInstance("localhost", 9001);
		try {
			Object obj = naming.lookup(Version.SERVICE_NAME);
			if (obj instanceof Version) {
				version = (Version) obj;
			}
			String versionString = version.getVersion();
			System.out.println(versionString);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
	}

}
